package com.icbc.open.chengdu.demo.settlement.query;

import com.icbc.api.DefaultIcbcClient;
import com.icbc.api.internal.util.internal.util.fastjson.JSON;
import com.icbc.api.request.SettlementAccountDealQueryRequestV1;
import com.icbc.api.response.SettlementAccountDealQueryResponseV1;
import com.icbc.open.chengdu.demo.BaseData;

/**
 * 结算账户可疑订单受理结果
 * 提供合作方通过合作方的订单号查询我行结算账户交易受理结果
 *
 * @author xcz
 */
public class SettlementAccountDealQueryTest {
    public static void main(String[] args) throws Exception {
        DefaultIcbcClient client = new DefaultIcbcClient(BaseData.APP_ID, BaseData.MY_RSA_PRIVATE_KEY, BaseData.ICBC_RSA_PUBLIC_KEY);
        SettlementAccountDealQueryRequestV1 request = new SettlementAccountDealQueryRequestV1();
        request.setServiceUrl(BaseData.ACCOUNT_DEAL_QUERY_URL);
        SettlementAccountDealQueryRequestV1.SettlementAccountDealQueryRequestV1Biz bizContent = new SettlementAccountDealQueryRequestV1.SettlementAccountDealQueryRequestV1Biz();
        bizContent.setCorpNo(BaseData.APP_ID); //合作方机构编号
        bizContent.setCorpSerno("546dhknvpuylolyj"); //合作方交易单号
        bizContent.setOutServiceCode("querydeal"); //外部服务代码
        request.setBizContent(bizContent);
        SettlementAccountDealQueryResponseV1 response = client.execute(request);
        System.out.println(JSON.toJSONString(response));
        if (response.isSuccess()) {
            //成功
        } else {

        }

    }
}
